package com.ssy.lingxi.search.api.feign;

import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.search.api.hystrix.SearchHystrix;
import com.ssy.lingxi.search.api.model.request.CommoditySkuRequest;
import com.ssy.lingxi.search.api.model.response.CommoditySkuResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.validation.Valid;
import java.util.List;

/**
 * 模板服务类
 * @author jw.chen
 * @version 2.0.0
 * @date 2022/1/26
 */
@FeignClient(value = "search-service", fallback = SearchHystrix.class)
public interface ISearchFeign {

    /**
     * 查询商品sku信息
     * @param commoditySkuRequest 请求参数
     */
    @RequestMapping(value = "/search/feign/searchCommodityList", method = RequestMethod.POST)
    Wrapper<List<CommoditySkuResponse>> getCommoditySkuList(@RequestBody @Valid CommoditySkuRequest commoditySkuRequest);

}
